const express = require('express');
const app = express();
const nunjucks = require('nunjucks');
const albums = require('./route/album.js')

//配置模板引擎，支持express
nunjucks.configure('view',{express:app});
//设置express的静态服务
app.use(express.static('public'));
app.use(express.static('albums'));

//监听首页请求
app.use('/',albums);

//处理错误
app.use(function(err,req,res,next){
    res.send('出错了');
})

app.listen(80);